﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mfOrderInfo.aspx.cs" Inherits="msBsc.WebUi.mMall.Seller.mfOrderInfo" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>手机地接客商城</title>
    <%=getMeta()%>
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/mGlobal.css" charset="gbk" />
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/css/home/base.css" charset="gbk" />
    <link href="/jqPlugin/laydate/skins/default/laydate.css" rel="stylesheet" charset="gbk" />
    <link href="/themes/mStyle1/css/public/mOrder.css" rel="stylesheet" />
    <%=getBodyBeforeJs()%>

    <script type="text/javascript" src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jBase.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jmPage.js"></script>
    <script type="text/javascript" src="/themes/Style1/jsQt.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/laytpl.js"></script>
    <script type="text/javascript" src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <script type="themes/wStyle1/js/comm/DateInfo.js"></script>
    <script type="text/javascript">
        $(window).load(function () {
        });
        //        $(window).bind('resize', function () { _self._ResizeHandler(_self); })
        //        .bind('scroll', function () { _self._ResizeHandler(_self); });
    </script>
    <!--head fix rgn-->
    <style type="text/css">
        .order_comm .fr_order_user {
            display: table-cell;
            vertical-align: middle;
            width: 68px;
        }

            .order_comm .fr_order_user .onle_chat {
                background: url("/themes/mStyle1/Image/Order/OnlineContact.png") no-repeat;
                cursor: pointer;
                display: block;
                height: 19px;
                width: 68px;
                background-size: 68px 19px;
            }
    </style>
    <base target="_self" />
</head>
<body>
    <div class="viewport">
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapHeaderMenuHtml(true) %>
        <form action='#' method="post" id="J_EmailForm">
            <input type="hidden" id="orderId" />
            <div id="c_order" class="c_order">
                <div class="order_comm">
                    <div class="fl_order_comm order_list_number"><span>订单号：</span><span id="orderNumber"></span></div>
                    <div class="fr_order_comm order_list_number order_stime">
                        <div style="padding-right: 10px; width: 100%">
                            <span>下单时间：</span>
                            <span id="singleTime"></span>
                        </div>
                    </div>
                </div>
                <div class="order_comm">
                    <div class="l_order_user">
                        <a id="djack_c_img" class="l_order_user_href">
                            <img id="djack_img" /></a>
                    </div>
                    <div class="r_order_user">
                        <a id="djack_name" class="r_order_user_href"></a>
                    </div>
                    <div class="fr_order_user">
                        <a id="online_chat" class="onle_chat" title="在线联系"></a>
                    </div>
                </div>
                <div class="end_order_time">
                    <div class="start_time">
                        <div>开始时间</div>
                        <div class="time_info" id="start_time"></div>
                    </div>
                    <div class="stop_time">
                        <div>结束实时间</div>
                        <div class="time_info" id="end_time"></div>
                    </div>
                    <div class="div_order_status">
                        <div>状态</div>
                        <div class="order_status" id="order_status"></div>
                    </div>
                </div>
                <div class="order_time">
                    <div class="l_order_time"><span>定金比例:</span></div>
                    <div class="c_order_time">
                        <span id="ratio" style="font-size: 13px;"></span>
                    </div>
                    <div class="r_order_time">
                        <span></span>
                    </div>
                </div>
                <div id="vehicle_list">
                    <%--<div class="order_vehicle_info" data-value="{{d.rows[i].VEHICLE_INFO_ID}}">
                        <div class="l_ovi">
                            <div class="c_l_ovi">
                                <img src="{{d.rows[i].VEHICLE_DEFAULT_PIC}}  196x140img.jpg" />
                            </div>
                        </div>

                        <div class="r_ovi">
                            <div>
                                <a class="n_vehicle">{{d.rows[i].VEHICLE_NAME}}</a>
                            </div>
                            <div>
                                <span class="info_vehicle" style="">{{d.rows[i].VEHICLE_SERVICE_TYPE}} / {{d.rows[i].VEHICLE_SEATS}}坐</span>
                            </div>
                            <div class="other_vInfo">
                                <div class="vehicle_price"><span class="v_price">{{d.rows[i].VEHICLE_PRICE_DAY}}</span>￥/天</div>
                            </div>
                        </div>--%>
                </div>
            </div>

            <div id="order_bottom" class="order_bottom">
                <%--<div class="lb_order">
                    <span class="lb_title">合计:</span><span id="total" class="lb_content">￥5000.00</span>
                </div>
                <div class="rb_order">
                    <a class="btn_submit" id="submitOrder" onclick="submitOrder()">提交订单</a>
                </div>--%>
                <%-- <div class="lb_order all_order" style="line-height: 18px">
                    <div>
                        <span class="lb_title">合计:</span><span id="total" class="lb_content">￥5000.00</span>
                    </div>
                    <div class="preferential">
                        <span class="lb_title">定金:</span><span id="Span1" class="lb_content">￥500.00</span>
                    </div>
                </div>--%>
            </div>

            <xmp id="svc_list_temp_vehicle" style="display: none">
             {{#for(var i=0,len=d.rows.length;i < len;i++){ }}
             <div class="order_vehicle_info" data-value="{{d.rows[i].PRODUCT_ID}}">
                        <div class="l_ovi">
                            <a href="/mp_VehicleInfo.htm?vehicleId={{d.rows[i].PRODUCT_ID}}" class="c_l_ovi">
                                <img src="{{d.rows[i].IMG_URL}}  196x140img.jpg" />
                            </a>
                        </div>

                        <div class="r_ovi">
                            <div>
                                <a class="n_vehicle" href="/mp_VehicleInfo.htm?vehicleId={{d.rows[i].PRODUCT_ID}}">{{d.rows[i].PRODUCT_NME}}</a>
                            </div>
                            <div>
                                <span class="info_vehicle" style="">{{d.rows[i].PRODUCT_SERVICE_NAME}} / {{d.rows[i].PRODUCT_SEATS}}坐</span>
                            </div>
                            <div class="other_vInfo">
                                <div class="vehicle_price"><span class="v_price">{{d.rows[i].PRODUCT_STRIKE_PRICE}}</span>￥/天</div>
                            </div>
                            <div class="preferential">
                                <span>优惠：</span><span>{{d.rows[i].DETAIL_DISCOUNT}}￥/天</span>
                            </div>
                        </div>
                    </div>
            {{#} }}
        </xmp>
        </form>
        <script type="text/javascript" src="/jqPlugin/laydate/laydate.js" charset="gbk"></script>
        <script src="/themes/wStyle1/js/comm/DateInfo.js"></script>
        <script type="text/javascript">
            (function () {
                $("#orderId").val(GetQueryStr("orderId"));
                $("#h_title").text("订单详情");
                $.getMessageCount();
                doto();
            })();
            function doto() {
                var opart = new jsonRow();
                opart.AddCell("orderId", $("#orderId").val());
                opart.AddCell("ACTION", "init");
                ajaxComm(opart);
            }
            function setOrder(data) {
                if (IsNull(data)) {
                    return;
                }
                $("#orderNumber").text(data.rows[0].ORDER_CODE);
                $("#singleTime").text(formatDate1(new Date(data.rows[0].ORDER_TIME)));
                $("#djack_img").attr("src", data.rows[0].CUSTOMER_DEFAULT_PIC);
                $("#djack_name").text(data.rows[0].CUSTOMER_NICK);
                $("#start_time").text(formatDate1(new Date(data.rows[0].ORDER_START_TIME)));
                $("#end_time").text(formatDate1(new Date(data.rows[0].ORDER_STOP_TIME)));
                $("#online_chat").attr("href", "/mb_ChatMessage.htm?receiveId=" + data.rows[0].CUSTOMER_REGISTER_ID + "&receiveName=" + data.rows[0].CUSTOMER_NICK);
                if (data.rows[0].DEPOSIT_RATIO == 0.20) {
                    $("#ratio").text("20%");
                } else if (data.rows[0].DEPOSIT_RATIO == 0.50) {
                    $("#ratio").text("50%");
                }
                var _html = $('#svc_list_temp_vehicle').html();

                laytpl(_html).render(data.rows[0], function (render) {
                    $('#vehicle_list').html(render);
                });
                if (data.rows[0].ORDER_STATUS == 1) {
                    if (CompareDate(new Date(), new Date(data.rows[0].ORDER_START_TIME)) == false) {
                        $("#order_status").text("已过期");
                        $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span id='Span1' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' onclick='deleteOrder()'>删除订单</a></div>");
                    } else {
                        $("#order_status").text("待确定");
                        $("#order_bottom").html(" <div class='lb_order three_bottom' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order three_bottom bc_order'><a class='btn_submit btn_change' href='/ms_ModifyOrder.htm?orderId=" + data.rows[0].ORDERS_INFO_ID + "'>修改价格</a></div><div class='rb_order three_bottom'><a class='btn_submit' onclick='OkOrder()'>确认订单</a></div>");
                    }
                }
                else if (data.rows[0].ORDER_STATUS == 2) {
                    if (CompareDate(new Date(), new Date(data.rows[0].ORDER_START_TIME)) == false) {
                        $("#order_status").text("已过期");
                        $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span id='Span1' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' onclick='deleteOrder()'>删除订单</a></div>");
                    } else {
                        $("#order_status").text("待付款");
                        $("#order_bottom").html(" <div class='lb_order all_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                    }
                }
                else if (data.rows[0].ORDER_STATUS == 3) {
                    $("#order_status").text("已付款");
                    $("#order_bottom").html(" <div class='lb_order three_bottom' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                }
                else if (data.rows[0].ORDER_STATUS == 4) {
                    $("#order_status").text("已完成");
                    //$("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span id='Span1' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' onclick='deleteOrder()'>删除订单</a></div>");
                }
                else if (data.rows[0].ORDER_STATUS == 5) {
                    $("#order_status").text("已关闭");
                    //$("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span id='Span1' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' onclick='deleteOrder()'>删除订单</a></div>");
                }
                else if (data.rows[0].ORDER_STATUS == 6) {
                    $("#order_status").text("正在退款");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' href='ms_RefundInfo.htm?orderId=" + data.rows[0].ORDERS_INFO_ID + "&orderStatus=" + data.rows[0].ORDER_STATUS + "'>查看退款详情</a></div>");
                }
                else if (data.rows[0].ORDER_STATUS == 7 || data.rows[0].ORDER_STATUS == 13) {
                    $("#order_status").text("已退款");
                    //$("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span id='Span1' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' onclick='deleteOrder()'>删除订单</a></div>");
                }
                else if (data.rows[0].ORDER_STATUS == 8) {
                    $("#order_status").text("已取消");
                    //$("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span id='Span1' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' onclick='deleteOrder()'>删除订单</a></div>");
                }
                else if (data.rows[0].ORDER_STATUS == 9) {
                    $("#order_status").text("已删除");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                }
                else if (data.rows[0].ORDER_STATUS == 10) {
                    $("#order_status").text("已取消退款");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                }
                else if (data.rows[0].ORDER_STATUS == 11) {
                    $("#order_status").text("拒绝退款");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' href='ms_RefundInfo.htm?orderId=" + data.rows[0].ORDERS_INFO_ID + "&orderStatus=" + data.rows[0].ORDER_STATUS + "'>查看退款详情</a></div>");
                }
                else if (data.rows[0].ORDER_STATUS == 12) {
                    $("#order_status").text("已拒绝订单");
                    //$("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div>");
                    $("#order_bottom").html("<div class='lb_order' style='line-height:18px'><div><span class='lb_title'>合计:</span><span id='total' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_TOTAL_AMT) + "</span></div><div class='preferential'><span class='lb_title'>定金:</span><span id='Span1' class='lb_content'>￥" + getNumber(data.rows[0].PAYABLE_AMT) + "</span></div> </div><div class='rb_order'><a class='btn_submit' onclick='deleteOrder()'>删除订单</a></div>");
                }
            }

            function OkOrder() {
                if (confirm("您确定要确认订单吗?") == false) {
                    return;
                }
                var opart = new jsonRow();
                opart.AddCell("orderId", $("#orderId").val());
                opart.AddCell("ACTION", "okOrder");
                ajaxComm(opart);
            }

            /*
                * 删除订单
            */
            function deleteOrder() {
                if (confirm("删除的订单是不可恢复的，您确定要删除吗?") == false) {
                    return;
                }
                var opart = new jsonRow();
                opart.AddCell("orderId", $("#orderId").val());
                opart.AddCell("ACTION", "deleteOrder");
                ajaxComm(opart);
            }
        </script>
    </div>
</body>
<%=getBodyAfterJs() %>
</html>
